/*
 * default Macros
 */

#include <stdio.h>
#include <stdlib.h>

#ifndef MAXPATHLEN
# define MAXPATHLEN 1024
#endif

#define ARGV0_MAXLEN 256
#ifdef __GNUC__
# define BUILD_STR "gcc (%d.%d.%d)", __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__
#else
# define BUILD_STR "(non gcc compiler)"
#endif
#ifdef __GNU_LIBRARY__
# if defined(__GLIBC__) && defined(__GLIBC_MINOR__)
#  define BUILDLIB_STR "glibc (%d.%d)", __GLIBC__, __GLIBC_MINOR__
# endif
#else
# define BUILDLIB_STR "(non gnu libc)"
#endif
#define BUILDTIME_STR __DATE__ " (" __TIME__ ")"

#ifndef __FUNC__
# define __FUNC__ (char *) __func__
# if __STDC_VERSION__ < 199901L
#  if __GNUC__ >= 2
#   define __func__ __FUNCTION__
#  else
#   define __func__
#  endif
# endif
#endif

#ifdef __GNUC__
# define __ncattr__ __attribute__ ((__packed__))
#else
# define __ncattr__
#endif

#if defined(_HAVE_CONFIG_H) || defined(_HAVE_CONFIG) || defined(HAVE_CONFIG_H) || defined(HAVE_CONFIG)
# include "config.h.in"
# include "config.h"
# ifdef HAVE_ASSERT_H
#  include <assert.h>
# endif
#else

#if defined(_HAVE_CONFIG_DBG) || defined(HAVE_CONFIG_DBG)
# include "config.debug.h"
# include <assert.h>
#else
# define assert(x)
#endif

#endif

#ifndef __NCTLS
# ifdef ENABLE_PTHREADS
#  include <pthread.h>
#  define __NCTLS __thread
# else
#  define __NCTLS static
# endif
#endif

#if defined(PACKAGE_NAME) && defined(PACKAGE_VERSION) && defined(PACKAGE_BUGREPORT)
# define NC_VERSION_STRING PACKAGE_NAME " " PACKAGE_VERSION " (" PACKAGE_BUGREPORT ")"
#else
# define NC_VERSION_STRING "(unknown)"
#endif

#define DO_PRAGMA(x) _Pragma (#x)
#define TODO(x) DO_PRAGMA(message ("TODO - " #x))
#define WARN(x) DO_PRAGMA(message ("WARNING - " #x))

extern void *memset(void *s, int c, size_t n);
extern char *strcpy(char *dest, const char *src);
extern size_t strlen(const char *s);
extern size_t strnlen(const char *s, size_t maxlen);
extern char *strchr(const char *s, int c);
extern char *strrchr(const char *s, int c);
extern char *strdup(const char *s);
extern char *strndup(const char *s, size_t n);
extern char *strstr(const char *haystack, const char *needle);
extern char *strtok_r(char *str, const char *delim, char **saveptr);
extern char *strerror(int errnum);
extern void *memcpy(void *dest, const void *src, size_t n);
extern void *memmove(void *dest, const void *src, size_t n);
extern int strcmp(const char *s1, const char *s2);
extern int strncmp(const char *s1, const char *s2, size_t n);
extern char *strcpy(char *dest, const char *src);
extern char *strncpy(char *dest, const char *src, size_t n);
extern char *strcat(char *dest, const char *src);
extern char *strncat(char *dest, const char *src, size_t n);

#include "bool.h"
#include "log.h"

